package exam;

import java.util.Scanner;

public class gunaglianda {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        int res = 0;
        int[][] to = new int[][]{
                {0,},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
        };//10*10
        int[] to0 = new int[]{6,2,5,5,4,5,6,3,7,6};
        for(int i=0;i<str.length();i++){
            if(i==0){
                res+=to0[str.charAt(i)-'0'];
            }else{
                res+=(to[str.charAt(i-1)-'0'][str.charAt(i)-'0']);
            }
        }
        
        System.out.println(res);
    }
}
